<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="com.traning.dto.Employee"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Search Employee</title>
</head>
<body>
	<%@ include file="/menu.jsp"%>
	<div id="content"
		style="background-color: green; height: 500px; float: center">

		<form action="search" method="post">
			<fieldset>
				<legend>Search Employee</legend>
				Enter Id <input type="text" name="empid"><br> <input
					type="submit">
			</fieldset>
		</form>
		<br> <br> <br>
		<%!Employee employee = null;%>
		<%
			employee = (Employee) request.getAttribute("searchedemployee");
		%>
		<%
			if (employee != null) {
		%>
		<form action="update" method="post">
			<fieldset>
				<legend>Search Results</legend>
				<table border="1">
					<thead>
						<tr>
							<th>Employee User ID</th>
							<th>Employee User Name</th>
							<th>Employee Password</th>
							<th>Employee Date Of Birth</th>
							<th>Employee Address</th>
							<th>Employee Phone</th>
							<th></th>
							<th></th>

						</tr>
					</thead>


					<tr>
                        <td><input type="text" name="empid"
							value="<%=employee.getId()%>"></td>
						<td><input type="text" name="empusername"
							value="<%=employee.getUsername()%>"></td>
						<td><input type="text" name="emppassword"
							value="<%=employee.getPassword()%>"></td>
						<td><input type="text" name="empdob"
							value="<%=employee.getDob()%>"></td>
						<td><input type="text" name="empaddress"
							value="<%=employee.getAddress()%>"></td>
						<td><input type="text" name="empphone"
							value="<%=employee.getPhone()%>"></td>

						<td><input type="submit" value="Update"></td>


					</tr>

				</table>
			</fieldset>
		</form>
		<%
			} else {
		%>
		<fieldset>
			<legend>Search Results</legend>
			<table border="1">
				<thead>
					<tr>
						<th>Employee User Name</th>
						<th>Employee Password</th>
						<th>Employee Date Of Birth</th>
						<th>Employee Address</th>
						<th>Employee Phone</th>
					</tr>
				</thead>
				<tr>
					<td>No results Found.</td>
					<td>No results Found.</td>
					<td>No results Found.</td>
					<td>No results Found.</td>
					<td>No results Found.</td>
				</tr>
			</table>
		</fieldset>
		<%
			}
		%>



	</div>
</body>
</html>